<template>
	<view class="my-wallet">
		<view class="card">
			<view class="price-detail">
				<view class="price_visabled">
					<view class="label"> 总资产 </view>
					<view class="icon"  @click="priceShow=!priceShow">
							<u-icon :name="priceShow?'eye-fill':'eye-off'" color="#fff" size="20"></u-icon>
					</view>
				</view>
				<view class="price_operation">
					<view class="detail">
						<text v-if="priceShow"
							style="font-size:50rpx;">{{accountDetailsData.userAmtNum || '0.00'}}</text>
						<text v-if="!priceShow" style="font-size:50rpx;">*****</text>
					</view>
					<view class="methods">
						<view class="withdrawal" @click="toUrl('/pages/comment/webView?title=提现')"> 提现 </view>
					</view>
				</view>
				<view class="total">
					<view class="income"> 收入:<text
							style="color: #FFFFFF;font-size: 28rpx;">{{accountDetailsData.incomeNum || '0.00'}}</text>
						</text>
					</view>
					<view class="expenditure"> 支出:<text
							style="color: #FFFFFF;font-size: 28rpx;">{{accountDetailsData.expensesNum || '0.00'}}</text>
					</view>
				</view>
			</view>
		</view>
		<view class="bill-details">
		</view>
	</view>
</template>
<script>
	import {
		getUserInfo
	} from "@/utils/storage.js"
	import {
		queryAccount,
		companyQueryAccount
	} from '@/common/api/pay.js'
	import {
		getToken
	} from '@/utils/token.js'
	export default {
		data() {
			return {
				priceShow: false,
				accountDetailsData: {},
			}
		},
		methods: {
			toUrl(path) {
				uni.navigateTo({
					url: path
				})
			},
			//查询用户总余额
			getQueryAccount() {
				getToken("version") == 1 ? queryAccount({
					userNo: getToken('useNum')
				}).then(res => {
					if (res.data && res.data.code == 200) {
						this.accountDetailsData = res.data.listData
					}
				}) : companyQueryAccount({
					companyId: getToken('useNum')
				}).then(res => {
					if (res.data && res.data.code == 200) {
						this.accountDetailsData = res.data.listData
					}
				})
			},
		},
		onLoad() {
			this.getQueryAccount()
		}
	}
</script>
<style lang="scss" scoped>
	.my-wallet {
		height: 100%;
		/* #ifdef APP-PLUS */
		height: 100vh;
		/* #endif */
		display: flex;
		flex-direction: column;
		overflow: hidden;

		.card {
			padding: 50rpx 30rpx 20rpx 30rpx;
			min-height: 260rpx;

			.price-detail {
				padding: 20rpx 0;
				background: linear-gradient(90deg, #015EEA 0%, #00C0FA 100%);
				border-radius: 10px;

				.price_visabled {
					height: 60rpx;
					color: #fff;
					display: flex;
					align-items: center;
					text-indent: 30rpx;

					.label {
						font-size: 30rpx;
					}
				}

				.price_operation {
					display: flex;
					justify-content: space-between;
					align-items: center;

					.detail {
						color: #fff;
						// text-indent: 10rpx;
						font-size: 36rpx;
						padding-left: 25rpx;
					}

					.methods {
						display: flex;
						justify-content: space-around;
						color: #fff;

						// .recharge {
						// 	display: flex;
						// 	justify-content: center;
						// 	align-items: center;
						// }
						.withdrawal {
							border: 1px solid #FFFFFF;
							border-radius: 13rpx;
							padding: 10rpx 20rpx;
							margin-right: 30rpx;
						}
					}
				}

				.total {
					padding: 40rpx 0 20rpx 0;
					display: flex;
					justify-content: space-between;
					text-indent: 30rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #FFFFFF;
					font-size: 24rpx;

					.expenditure {
						padding-right: 30rpx;
					}
				}
			}
		}

		.bill-details {
			flex: 1;
			overflow: hidden;
			display: flex;
			flex-direction: column;
			margin-top: 60rpx;

			.tabs {
				height: 100rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 0 30rpx;
			}

			.detail {
				flex: 1;
				padding: 20rpx 30rpx;
				overflow: hidden;

				.list {
					padding: 20rpx 0;
					border-bottom: 2rpx solid #f3f4f6;
					line-height: 60rpx;

					.operation-mode {
						display: flex;
						justify-content: space-between;

						.left_title {
							color: #000;
						}

						.right_price {
							color: red;
							font-size: 40rpx;
						}
					}

					.detail_mode {
						font-size: 24rpx;
						display: flex;
						justify-content: space-between;
						color: #616161;

						.left_mode {
							width: 50%;
						}

						.right_time {}
					}
				}
			}
		}
	}
</style>
